<?php

/**
 * Team form.
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class TeamForm extends BaseTeamForm
{
  public function configure()
  {
  		unset($this['nba_debut'],$this['years_bro']);
  		
			# WIDGETS
      $this->widgetSchema['name'] 	    = new sfWidgetFormInputText(array(), array());
      $this->widgetSchema['logo']    		= new sfWidgetFormInputFile(array(), array());
      $years = range(date('Y')-30, date('Y'));
      $this->widgetSchema['founded']    = new sfWidgetFormDate(array('format'=>'%year%', 'years'=>array_combine($years, $years)), array('class'=>'w60px'));
      $choices = GlobalLib::getArray('gender');
      $this->widgetSchema['gender']     = new sfWidgetFormChoice(array('choices'=>$choices), array('class'=>'w60px'));
      $this->widgetSchema['country_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Country'), 'add_empty' => false));
    	$this->widgetSchema['state_id']   = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('CountryState'), 'add_empty' => false));
      $this->widgetSchema['owner']      = new sfWidgetFormInputText();
    	$this->widgetSchema['biography']  = new sfWidgetFormTextarea(array(), array());
    	$this->widgetSchema['facebook']   = new sfWidgetFormInputText(array(), array());
    	$this->widgetSchema['twitter']    = new sfWidgetFormInputText(array(), array());
    	$this->widgetSchema['youtube']    = new sfWidgetFormInputText(array(), array());
    	
    	# DEFAULTS
      $this->setDefault('country_id', 147);
      $this->setDefault('state_id', 73);
    	  	
    	# VALIDATORS
    	$this->validatorSchema['name']   	   = new sfValidatorString();
    	$this->validatorSchema['logo'] 		   = new sfValidatorFile($this->getFileAttrs('t'), $this->getFileOpts());
    	$this->validatorSchema['founded']    = new sfValidatorPass();
    	$this->validatorSchema['gender']     = new sfValidatorPass();
    	$this->validatorSchema['country_id'] = new sfValidatorPass();
    	$this->validatorSchema['state_id']   = new sfValidatorPass();
    	$this->validatorSchema['owner']      = new sfValidatorPass();
    	$this->validatorSchema['biography']  = new sfValidatorPass();
    	$this->validatorSchema['facebook']   = new sfValidatorPass();
    	$this->validatorSchema['twitter']    = new sfValidatorPass();
    	$this->validatorSchema['youtube']    = new sfValidatorPass();
    	
    	# HELP
    	$this->widgetSchema->setHelp('logo', $this->getFileHelp());
  }
  

}
